<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:p="http://primefaces.org/ui"
		xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>

	<h:body>
        
        <div id="logoHomePage" align="left">
			<a href="homepage.xhtml"><img src="grafica\TravelDream_Logo.gif" width="150" height="75"/></a>
		</div>
		
		<div id="logout" align="right">
        	<h:form>
        	    <a href="users\index.xhtml">Pagina Personale</a>
				<h:commandButton action="#{logoutBean.logout}" value="Logout" />
			</h:form>
		</div>
 
		<div id="formPersonalizzaPacchetto">

			<h:form id="form">  
			  
			<p:growl id="growl" showDetail="true"/>  
			
			<p:tabView orientation="left">  
		    <p:tab title="Pacchetti"> 
			    <p:dataTable id="pacchetti" var="p" value="#{pacchettoBean.pacchetti}" paginator="true" rows="10"  
			                 selection="#{pacchettoBean.nuovoPacchetto}" selectionMode="single" rowKey="#{p.idPacchetto}">  
			  
			        <p:ajax event="rowSelect" listener="#{pacchettoBean.onRowSelect}" 
			          	 update=":form:display :form:growl" oncomplete="PF('Dialog').show()"  />
			        <p:ajax event="rowUnselect" listener="#{pacchettoBean.onRowUnselect}" />  
			
			
			        <p:column headerText="NOME">  
			            #{p.nome}  
			        </p:column>  
			        <p:column headerText="AEROPORTOPARTENZA">  
			            #{p.volo.aeroportoPartenza}  
			        </p:column>  
			        

			    </p:dataTable>  
			  </p:tab>
			  	
			</p:tabView>  
			  
			    <p:dialog id="dialog" header="Personalizza Pacchetto" widgetVar="Dialog" resizable="false"  
			                showEffect="fade" hideEffect="explode">  
			  
			        <h:panelGrid id="display" columns="2" cellpadding="4">  
			  
			            <h:outputLabel for="nome">Nome:</h:outputLabel>
						<p:inputText id="nome" value="#{pacchettoBean.nuovoPacchetto.nome}" />
						<p:message for="nome" />
						<h2></h2>
						<h:outputLabel for="aeroportoPartenza">Aeroporto Partenza:</h:outputLabel>
						<p:inputText id="aeroportoPartenza" value="#{pacchettoBean.nuovoPacchetto.volo.aeroportoPartenza}" />
						<p:message for="aeroportoPartenza" />
						<h2></h2>
						

						<p:commandButton value="ConfermaPersonalizzazione"
							action="#{pacchettoBean.personalizza()}" />

			        </h:panelGrid>  
			    </p:dialog> 
			    	
			  	
			
			</h:form>  

		</div>
		
		      <p:commandButton value="Personalizza"
				action="#{pacchettoBean.persPacc()}" />
			    
    </h:body>
</html>
